package com.xiangfei.demo.controller;

import com.xiangfei.demo.dao.UserMapper;
import com.xiangfei.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * 类名称：
 * 类描述：
 *
 * @author xiangfei
 * 创建时间：2018-09-20 09:44
 */
@Controller
public class UserController {
    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/selectUser")
    public String selectUser(int id, Map<String,Object> map){
        User user = userMapper.selectByPrimaryKey(id);
        map.put("user", user.toString());
        return "/success";
    }
}
